import request from '@/utils/request'
// 获取banner
export function getBanners(query) {
  return request({
    url: '/banners',
    method: 'GET',
    params: query
  })
}
// 新增banner
export function addBanner(data) {
  return request({
    url: '/banner/add',
    method: 'POST',
    data
  })
}
// 根据id获取banner
export function getBannerById(id) {
  return request({
    url: `/banner/${id}`,
    method: 'GET'
  })
}
// 更新banner
export function updateBanner(id, data) {
  return request({
    url: `/banner/update/${id}`,
    method: 'PUT',
    data
  })
}

export default {
  getBanners,
  addBanner,
  getBannerById,
  updateBanner
}